package com.briup.estore.web.servlet;

import com.briup.estore.common.result.Result;
import com.briup.estore.common.vo.CategoryInfoVO;
import com.briup.estore.service.CategoryService;
import com.briup.estore.service.impl.CategoryServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author briup-adam
 * @Date 2023/8/9 下午2:57
 * @Description 数据分类展示
 **/
@WebServlet("/category/list")
public class CategoryListServlet  extends  BaseServlet{
   private  CategoryService categoryService= new CategoryServiceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<CategoryInfoVO> list = categoryService.getAllCategory();
        writeData(resp, Result.success(list));
    }

}
